package bookez.view.util;

import java.util.Locale;
import java.util.ResourceBundle;

import bookez.view.bean.UnicodeBundle;

/**
 * This class is a utility to create UnicodeResourceBundle.
 * @author Genzer
 *
 */
public abstract class BundleUtil {
	
	public static final ResourceBundle getBundle( String baseName ) {
		ResourceBundle bundle = ResourceBundle.getBundle(baseName);
		return createUnicodeBundle( bundle );
	}

	public static final ResourceBundle getBundle(String baseName, Locale locale) {
		ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale);
		return createUnicodeBundle( bundle );
	}

	public static ResourceBundle getBundle(String baseName, Locale locale, ClassLoader loader) {
		ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale, loader );
		return createUnicodeBundle( bundle );
	}
	
	private static ResourceBundle createUnicodeBundle( ResourceBundle bundle ) {
		return new UnicodeBundle( bundle );
	}//end method crate

}//end class BundleUtil
